meta:
  id: ars_parse
  endian: be
seq:
  - id: header
    type: header_str
  - id: body
    size: header.length-8
    type:
      switch-on: header.method_id
      cases:
        1: detection_list
        2: object_list
types:
  header_str:
    seq:
      - id: service_id
        type: u2
      - id: method_id
        type: u2
      - id: length
        type: u4
      - id: client_id
        type: u2
      - id: session_id
        type: u2
      - id: protocol_version
        type: u1
      - id: interface_version
        type: u1
      - id: message_type
        type: u1
      - id: return_code
        type: u1
  detection_list:
    seq:
      - id: empty
        type: u1
        repeat: eos
  object_list:
    seq:
      - id: empty
        type: u1
        repeat: eos